---
import BasicMarkdownLayout from "@/layouts/BasicMarkdownLayout/index.astro";
import ColorMap from "@/styles/PersonalThemeColor";
import { ItemList, BasicList } from "./_utils/getContentList";
---

<BasicMarkdownLayout
  title="词条总览"
  showEdit={false}
  color="#976961"
  pagefindIgnore
>
  <p>
    该页面用于收录所有词条。包括但不限于 mod
    内外的内容，也包含部分物品来源以及梗来源。
  </p>
  <p>该部分修改需要加入 Wiki 管理群进行反馈。管理群:831277455</p>
  <strong>你可以使用右侧索引来查找相关 liver 或使用 Ctrl+F 来搜索物品</strong>
  <h2 id="物品">物品</h2>
  {
    Object.entries(ItemList).map(([liver, list]) => (
      <>
        <h3
          id={ColorMap[liver as keyof typeof ColorMap].cnName}
          style={{
            "--theme-color": ColorMap[liver as keyof typeof ColorMap].color,
          }}
          data-pagefind-ignore="all"
        >
          {ColorMap[liver as keyof typeof ColorMap].cnName}
        </h3>
        <div class="flex gap-3 flex-wrap" data-pagefind-ignore="all">
          {list.map(({ item: v }) => (
            <a class="flex items-center !text-white gap-1" href={v.link}>
              {v.smallIcon && (
                <img
                  class="!bg-transparent w-6 h-6"
                  src={v.smallIcon}
                  alt={v.name}
                />
              )}
              {v.name}
            </a>
          ))}
        </div>
      </>
    ))
  }
  {
    BasicList.map(({ name, list }) => {
      return (
        <>
          <br />
          <h2 id={name} data-pagefind-ignore="all">
            {name}
          </h2>
          <div class="flex gap-3 flex-wrap" data-pagefind-ignore="all">
            {list.map((v) => (
              <a class="flex items-center !text-white gap-1" href={v.link}>
                {v.smallIcon && (
                  <img
                    class="!bg-transparent w-6 h-6"
                    src={v.smallIcon}
                    alt={v.name}
                  />
                )}
                {v.name}
              </a>
            ))}
          </div>
        </>
      );
    })
  }
</BasicMarkdownLayout>
